#pragma once
/*
 * @breif 锁屏
 */

typedef enum {
    E_LOCK_STATUS_UNLOCKED,    // 未锁屏
    E_LOCK_STATUS_LOCKED,      // 锁屏
    E_LOCK_STATUS_SCREEN_OFF   // 屏幕关闭
} E_LOCK_STATUS;

extern int SCREEN_LOCK_TIME;
class Lock{
private:
    Lock();
    ~Lock();

public:
    static Lock* getInstance();

    void lock(bool screen_off = false);      //锁屏(可选是否屏幕关闭)
    void unlock();    //解锁
    void screenOff(); //屏幕关闭
    void screenOn();  //屏幕打开
    void reset();     //重置锁屏计时
    E_LOCK_STATUS getStatus() const;  //获取锁屏状态
    void timeRun();      // 计时

    void setLockOpen(bool is_open);  // 设置锁屏启用开关
    bool getLockOpen() const;  			// 获取锁屏启用开关
    void set_auto_count(bool isCount);	//计时启用

private:
    int _lock_count;            // 锁屏计时
    int _screen_off_count;      // 屏幕关闭计时
    E_LOCK_STATUS _status;      // 锁屏状态
    bool _is_lock_open;        // 锁屏启用开关
    bool _is_lock_count;		//是否计时
};
#define LOCK_SCREEN Lock::getInstance()

